<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?=$title?></title>	
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta  http-equiv="description" content="Free open source blog software based on codeigniter." />
    <meta http-equiv="keywords" content="Free,open,source,blog,website,codeigniter,web design,speedovation,hosting" />
    <meta http-equiv="author" content="Yash Bharadwaj" />
	<link rel="stylesheet" href="<?=base_url()?>themes/refreshblog/css/default.css" type="text/css" media="screen, projection" />
	<link rel="stylesheet" href="<?=base_url()?>themes/refreshblog/css/table.css" type="text/css" media="screen, projection" />
</head>

<body>
<div id="header">
		<!--
        you can use this for blog name and sllogan etc...
        < ?php
		$site_name=$this->config->item('site_name');
		$site_slogan=$this->config->item('site_slogan');
		$sub_site_slogan=$this->config->item('sub_site_slogan');
		 ?>
			<h1>< ?=anchor('blog/',$site_name,'Home')?> - < ?=$site_slogan?></h1>
		  <p>< ?=$sub_site_slogan?></p>
         -->  
          
            <div  class="top"> </div>
            <div  class="middle">
            		<div class="leftmenu"></div>	
                    <div class="centermenu">
                      		<ul id="nav">
                            		<li><?=anchor('blog/','Home');?></li>
									<?=$pages?>
                             </ul>
                    </div>		
                    <div class="rightmenu"></div>
            
            </div>
  <div class="bottom">&nbsp;</div>
 </div><!--end of header -->

<div id="blogbody">


     
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td  valign="top">
                    <div id="postarea">
                    
                            <div  class="top"> &nbsp;</div>
                            <div  class="middle">&nbsp;
                         <?php
						//we're checking for Guest permissions.Whether he can see the blog  or not.
                         if($this->session->userdata('GuestView')==1||$this->uri->segment(1)=="users")
                            {
						 
						 //  print_r( $allposts);
						   
						   for($i=0;$i<count($allposts)-1;$i++)
						   { ?>
						   		
								<div id="post">
								<div class="top">&nbsp;</div>
								<div class="middle">
                                        <span class="post-title"><?=$allposts[$i]['title_link']?></span>
                                        <?php  if($this->uri->segment(2)!="page") {		   ?>
                                        <span class="date"><?=$allposts[$i]['date']?> By: <?=$allposts[$i]['author_name']?></span>
                                        <?php } ?>
                                        
                                        <span><?=$allposts[$i]['content']?>&nbsp;</span>
                                        
                                       <?php  if($this->uri->segment(2)!="page") {		   ?>
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td><strong>Categories</strong> : <?=$allposts[$i]['categories']?></td>
                                                <td>Total Comments : <?=$allposts[$i]['comment_link']?></td>
                                            </tr>
                                        </table>
                                        <?php } ?>
                                        
                                </div>           
								<div class="bottom"></div>
						  </div>	
						  <?php 
                        }
						//  if($allposts['full']==true)
						  
						  echo $allposts['last'];
						  
						  if($allposts[0]['full'])
						  {
						  		echo $read_comments.'<p>&nbsp;</p>';
								echo $comment_form;
						   }
						  
						 }
                           else
						   echo "Please login! This is for members only site";
						   ?>
                           
                            
                            <!--<div id="post">
                                                    <div  class="top"> &nbsp;</div>
                                                    <div  class="middle">&nbsp;</div>
                                                    <div class="bottom">&nbsp;</div>
                              </div> -->
                           
                            </div><!--end of #postarea  .middle  each post ,page ect will come inside this-->
                            <div class="bottom">&nbsp;</div>
                            
                  </div><!-- end of postarea-->
  </td>
    <td valign="top">
    
                 <div id="sidebar"><br />

                            <?php 
							//known bug two form can't work together working to remove this.
							 if($this->uri->segment(1)!="users" &&$this->uri->segment(2)!="do_search" )  { ?>
							<h2>Search</h2>
                            <div  class="top"> &nbsp;</div>
                            <div  class="middle" align="center">&nbsp;<?=$SearchForm; ?>&nbsp;</div>
                            <div class="bottom">&nbsp;</div><? } ?>

                            <?php if($this->session->userdata('ShowCategories')==1) {?>
                            <h2>Categories</h2>
                             <div  class="top"> &nbsp;</div>
                            <div  class="middle"><?=$Categories?> </div>
                            <div class="bottom">&nbsp;</div>
                            <?php }?>
                            
                            <?php if($this->session->userdata('ShowRecentPosts')==1) {?>
                             <h2>Latest Entries</h2>
                            <div  class="top"> &nbsp;</div>
                            <div  class="middle"><?=$RecentPosts?></div>
                            <div class="bottom">&nbsp;</div>
                            <?php }?>
                            
                            <?php if($this->session->userdata('ShowRecentComments')==1) {?>
                             <h2>Latest  Comments</h2>
                            <div  class="top"> &nbsp;</div>
                            <div  class="middle"><?=$RecentComments?></div>
                            <div class="bottom">&nbsp;</div>
                            <?php }?>
                             
                            <?php if($this->session->userdata('ShowArchives')==1) {?>
                            <h2>Archives</h2>
                            <div  class="top"> &nbsp;</div>
                            <div  class="middle"><?=$Archives?></div>
                            <div class="bottom">&nbsp;</div>
                           	<?php }?>
                           
                           <h2>Users</h2>
                          <div  class="top"> &nbsp;</div>
                           <div  class="middle">
                            
									   <?php
                                        if($this->session->userdata('logged_in'))
                                        {?>
                                        <ul>
                                            <li>&nbsp;&nbsp;&nbsp;&nbsp;Welcome <?=$this->session->userdata('first_name')?>&nbsp;<?=$this->session->userdata('last_name')?></li>
                                            <li><?=anchor('users/ViewProfile/'.$this->session->userdata('user_id'),'View Profile')?></li>
                                            <li><?=anchor('users/Logout','Logout')?></li>
                                        </ul> 
                                       <?php } else {?>
                                        <ul>
                                            <li><?=anchor('users/Register','Register')?></li>
                                            <li><?=anchor('users/Login','Login')?></li>
                                            <li><?=anchor('users/ForgetPassword','Forget Password')?></li>
                                        </ul>
                                        <?php }?>
                       		 </div>
                            <div class="bottom">&nbsp;</div>
                          
                       
                      		 <h2>TagClouds</h2>
                             <div  class="top"> &nbsp;</div>
                            <div  class="middle">
                            			<div class="tag-cloud"> <?=$TagClouds?></div>
                            </div>
                            <div class="bottom">&nbsp;</div>
                            
                      	  <?php if($this->session->userdata('ShowCalendar')==1) {?> 
                   		  <h2>Calendar</h2>
                          <div  class="top"> &nbsp;</div>
                          <div  class="middle">
                          		<div  align="center"> <?=$this->calendar->generate();?></div>
                          </div>
                          <div class="bottom">&nbsp;</div> 
                       	  <?php }?>
                     
                        
                            
                </div><!--end of sidebar -->
      </td>
  </tr>
</table>


	<div class="bottom">&nbsp;</div>
</div>     <!-- end of blogbody-->

<div id="footer">
			<div  class="top"> &nbsp;</div>
			<div  class="middle"><ul>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">About</a></li>
                        <li><a href="#">Support</a></li>
                        <li><a href="#">Documentation</a></li>
                        <li><a href="#">Contact</a></li>
                      </ul><!--Blog Lower Links -->&nbsp;</div>
			<div class="bottom" >
            	<a href="http://speedovation.org" title="Open Source Blogging Software ">Blogmer</a> Powered by : <a href="http://speedovation.com" title="Powered By Speedovation">Speedovation</a><br />
                <a href="http://speedovation.org/" title="Blogmer Theme">Refreshblog</a> Theme Design by : <a href="http://speedovation.com" title="Theme Design by : Speedovation">Speedovation</a><br />
              This <?=anchor(base_url(),$this->session->userdata('BLOGName'),array('title' => $this->session->userdata('BLOGTitle')));?> is maintained by : <?=$this->session->userdata('BLOGMaintainedBy')?>
			</div>
				
</div>


</body>
</html>
